import 'package:app_admin/models/order_set_info.dart';
import 'package:app_admin/routes/app_navigator.dart';
import 'package:get/get.dart';

class OrderSetLogic extends GetxController {
  final datas = <OrderSetInfo>[].obs;

  @override
  void onReady() {
    _getDatas();
    super.onReady();
  }

  ///获取数据
  void _getDatas() async {
    final allList = <OrderSetInfo>[];
    for (var i = 0; i < 11; i++) {
      var t = OrderSetInfo(
          id: "10",
          order: "WD2023103000001",
          orderTime: "2015-10-02",
          orderPlayerName: "一号车队",
          goods: "早班",
          level: "三类",
          num: 123123123,
          price: 1.00,
          total: 10000);

      allList.add(t);

      datas.assignAll(allList);
    }
  }

  void addSet() {
    AppNavigator.startOrderSetAdd();
  }

  void viewData(OrderSetInfo info) {
    AppNavigator.editorOrderSetAdd(info);
  }
}
